/* 画布容器 */
.canvas-container {
  position: relative;
  height: 100%;
  overflow: auto;
  background-color: #f0f2f5;
  border: 1px solid #d9d9d9;
  border-radius: 2px;
  outline: none;
}

/* 画布网格 */
.canvas-grid {
  min-height: 800px;
  position: relative;
  margin: 20px;
}

/* 显示网格线 */
.show-grid {
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

/* 组件容器 */
.component-wrapper {
  position: relative;
  height: 100%;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: all 0.3s;
  overflow: hidden;
}

/* 组件选中状态 */
.component-wrapper.selected {
  border: 1px solid #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 锁定组件样式 */
.component-wrapper.locked {
  border: 1px dashed #ff4d4f;
}

/* 组件内容 */
.component-content {
  width: 100%;
  height: 100%;
  padding: 4px;
  overflow: auto;
}

/* 组件操作按钮 */
.component-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 0 0 0 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

/* 选择框 */
.selection-box {
  position: absolute;
  border: 1px dashed #1890ff;
  background-color: rgba(24, 144, 255, 0.1);
  pointer-events: none;
  z-index: 100;
}

/* 拖放区域 */
.canvas-drop-area {
  min-height: 100%;
  width: 100%;
}

/* 画布工具栏 */
.canvas-toolbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background-color: white;
  padding: 8px 16px;
  border-bottom: 1px solid #e8e8e8;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 对齐参考线 */
.alignment-line {
  position: absolute;
  background-color: #ff4d4f;
  pointer-events: none;
  z-index: 1000;
}

.alignment-line.horizontal {
  height: 1px;
  left: 0;
  right: 0;
}

.alignment-line.vertical {
  width: 1px;
  top: 0;
  bottom: 0;
}

/* 网格点 */
.grid-point {
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: rgba(24, 144, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.show-grid .grid-point {
  opacity: 1;
}

/* 吸附提示 */
.snap-indicator {
  position: absolute;
  background-color: #52c41a;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1001;
  box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.2);
  opacity: 0;
  transition: opacity 0.2s;
}

.snap-indicator.active {
  opacity: 1;
} 